﻿using System.Collections.Generic;
using Avalonia.Controls;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView.VisualElements;

namespace WeatherCore.App.Views;

public partial class DataWindow : Window
{
    public DataWindow()
    {
        InitializeComponent();
        Chart.Title = new LabelVisual
        {
            Text = "WeatherCore"
        };
    }

    public void Change(IEnumerable<ISeries> data, string title = "")
    {
        Chart.Series = data;
        if (!string.IsNullOrEmpty(title))
            Chart.Title = new LabelVisual
            {
                Text = title
            };
    }
}